package io.file;

import java.io.IOException;
import java.io.RandomAccessFile;

public class RAFile {
	public static void main(String args[]) throws IOException {
		RandomAccessFile rfc1 = new RandomAccessFile("file1.txt", "r");
		RandomAccessFile rfc2 = new RandomAccessFile("file3.txt", "rw");
		int ch;
		while ((ch = rfc1.read()) != -1) {
			rfc2.write(ch);
			System.out.print((char) ch);
		}
	}
}